﻿using System;
using System.Collections.Generic;
using System.Text;

namespace iFinity.DNN.Modules.CatalookUrlProvider.Entities
{
    internal class FriendlyUrlInfo
    {
        public int itemId;
        public int parentId;
        public string itemType;
        public string urlFragment;
        public DateTime urlDate;
        public int urlNum;
        public string cultureCode;
        internal string FUrlPrefix
        {
            get
            {
                return GetPrefix(itemType);
            }
        }
        internal static string GetPrefix(string itemType)
        {
            string prefix = "";
            switch (itemType.ToLower())
            {
                case "product":
                    prefix = "p";
                    break;
                case "category":
                    prefix = "c";
                    break;
                case "advcategory":
                    prefix = "ac";
                    break;
            }
            return prefix;
        }
        internal static string GetItemKey(int itemId, string itemType, string cultureCode)
        {
            string prefix = GetPrefix(itemType);
            string key = prefix + itemId.ToString() + "-" + cultureCode;
            return key;
        }
        internal string FUrlKey
        {
            get
            {
                return GetItemKey(itemId, itemType, cultureCode);
            }
        }
    }
    internal class FriendlyUrlInfoCol : List<FriendlyUrlInfo>
    {
    }
}
